package com.qc31.comlib.entity

import android.os.Parcelable
import com.qc31.comlib.Keys
import com.qc31.comlib.UserConstant
import kotlinx.parcelize.Parcelize
import java.io.Serializable

/** @Author pc_hfjs @Date 2022/1/18 15:18 @Desc 新接口统一文件 */
@Parcelize
data class OilDayBean(
    val cfgs: Map<String, List<String>>?,
    val datas: List<Data>?
) : Parcelable {
    @Parcelize
    data class Data(
        val carId: String, // 105160
        val day: String, // 2022-01-16
        var downTimes: Int, // 0
        var downTotal: Float, // 0
        val leakTimes: Int, // 0
        var leakTotal: Float, // 0
        val list: String?, // [{"e":{"lat":31.3238,"lng":121.637704,"m":1421.0,"mile":0.0,"time":"2022-01-17 12:21:12","v":182.05},"s":{"lat":31.3238,"lng":121.637704,"m":1422.0,"mile":0.0,"time":"2022-01-17 12:19:12","v":182.19},"t":"D"}]
        var mile: Float, // 0
        val type: String, // 1
        val typeId: String?, // 6
        val upTimes: Int, // 0
        var upTotal: Float, // 0
        var oilAvg: Float?
    ) : Parcelable
}

@Parcelize
data class OilType(
    val id: String,
    val name: String,
    val unit: String,
    val precision: String,
    val info: ArrayList<OilDayBean.Data> = arrayListOf()
) : Parcelable

/** 日油耗详情 */
@Parcelize
data class OilDetail(
    val adds: List<AddLeak>,
    val details: List<Detail>,
    val leaks: List<AddLeak>
) : Parcelable {
    @Parcelize
    data class Detail(
        val acc: Boolean, // true
        val index: Int, // 0
        val m: Float, // 1368
        val mile: Int, // 0
        val s: Float, // 0
        val time: String, // 2022-01-25 00:00:19
        val v: Float, // 175.27
        val v0: Float // 175.27
    ) : Parcelable

    @Parcelize
    data class AddLeak(
        val etime: String, // 2022-01-25 00:08:49
        val evalue: Float, // 148.24
        val mile: Int, // 300
        val stime: String, // 2022-01-25 00:00:19
        val svalue: Float, // 175.27
        var value: Float // 27.029999
    ) : Parcelable
}


data class Permissions(
    val permission: String,
    val type: String,
    val desc: String,
    val permission2: String = "",
    var isOpen: Boolean = false,
)

/** 定位简易信息 */
data class GpsSimple(
    val accTime: String, // 关8时2分30秒
    val blat: String, // 32.11972192769155
    val blng: String, // 118.83891059281379
    val lat: String, // 32.11972192769155
    val lng: String, // 118.83891059281379
    val carId: String, // 17311
    val carName: String, // 14631651004
    val carPlate: String, // 14631651004
    val drct: String, // 64
    val drctCn: String, // 东北
    val glat: String, // 32.113770260621536
    val glng: String, // 118.83241120760951
    val iconLink: String, // http://106.14.186.44:9999/gps-web/rs/img/map/car/default/9.png
    val mile: String, // 38020.34
    val runStopTime: String, // 停-26分3秒
    val speed: String, // 0
    val state: String, // 9
    val stateCn: String, // 在线-停车-ACC关
    val time: String // 2020-08-05 11:21:32
)

/** 定位详细信息 */
data class GpsDetail(
    val accTime: String, // 当前[开] 今日开:12时56分26秒
    val addr: String?, // 安徽省阜阳市颍州区文峰街道;阜王路236号;华联大厦-东门,阜阳市农业委员会办公二区,金龙鱼(华联大厦提货点)
    val alarms: String?,
    val bigIcon: String, // 轿车/1.png
    val bigIconLink: String, // http://106.14.186.44:9999/gps-web/rs/img/car/bigs/轿车/1.png
    val blat: String, // 32.89647204943718
    val blng: String, // 115.81851493347635
    val carId: String, // 105235
    val carName: String, // 演示04
    val carPlate: String, // 演示04
    val carType: String, // 轿车
    val drct: String, // 0
    val drctCn: String, // 正北
    val drvName: String, // 张国栋
    val drvPhone: String,
    val drvSign: String,
    val drvSignPhone: String,
    val drvSignTime: String,
    val drvSignTimeLong: String,
    val expState: String, // 0
    val expTime: String? = "", // 2023-01-21
    val exts: String, // {"tcp":"bb","bd":"02","be":"0","c7":"4","sz1":"01","b0":"0","b1":"0","srvTime":"20220316153232"}
    val glat: String, // 32.89018909766766
    val glng: String, // 115.81208471785094
    val iconLink: String, // http://106.14.186.44:9999/gps-web/rs/img/map/car/default/10.png
    val mile: String, // 231783.47
    val oil: String, // 0.0升
    val photoIcon: String,
    val plateColor: String, // 黄色
    val plateColorCode: String?, // 黄色
    val preMile: String, // 489.84
    val runStopTime: String, // 停-42分11秒
    val runStopTimeSecond: String, // 2531
    val satl: String, // 强-28
    val sgn: String, // 强-28
    val simCard: String, // 13300000004
    val speed: String, // 0
    val st1: List<NameValue>?,
    val st2: List<NameValue>?,
    val st3: List<NameValue>?,
    val st4: List<NameValue>?,
    val st5: List<NameValue>?,
    val state: String, // 10
    val stateCn: String, // 在线-停车-ACC开
    val teamId: String, // 4771
    val teamName: String, // 一车队
    val time: String, // 2022-03-16 15:32:33
    val tmnExpirTime: String?,
    val tmnKey: String?, // 13300000004
    val tmnNo: String, // 13300000004
    val tmnType: String?,
    val owner: String?,
    val ownerPhone: String?,
    val uploadFlag: String, // false
    val videoAlarmTypes: List<String>?,
    val videos: String // {"vs":"4:通道1:0:v,2::0:v,3::0:v,1:通道4:0:v"}
)

/** 历史轨迹 */

data class HistoryLine(
    val alarmData: List<AlarmData>,
    val countData: CountData,
    val locations: List<Location>,
    val overspeedData: List<OverspeedData>,
    val stopData: List<StopData>
) {
    data class AlarmData(
        val addr: String, // 北京市海淀区花园路街道;北土城西街甲103号;健德门(地铁站),北京万盛商务会馆-A区,北京万盛商务会馆
        val alarmType: String, // 禁行报警
        val blat: String, // 39.98370717817938
        val blng: String, // 116.38775510989693
        val glat: String, // 39.97750718201819
        val glng: String, // 116.38130702773776
        val lat: String, // 39.976116
        val lng: String, // 116.375072
        val long: String, // 6分31秒
        val solveTime: String, // 2022-03-28 04:50:14
        val speed: String, // 52
        val startTime: String // 2022-03-28 01:50:08
    )

    data class CountData(
        val avgSpeed: String, // 37
        val gpsSize: String, // 432
        val maxSpeed: String, // 117
        val mile: String, // 31.53
        val moveLong: String, // 1时9分35秒
        val stopLong: String // 48分21秒
    )

    data class Location(
        val addr: String, // 北京市西城区月坛街道;复兴门北大街甲1号;北京月坛体育馆,金融四界,北京金融资产交易所
        val blat: String, // 39.92225687799531
        val blng: String, // 116.36302800297184
        val drct: String, // 177
        val drctCn: String, // 偏南
        val glat: String, // 39.916489006754574
        val glng: String, // 116.3564644408596
        val lat: String, // 39.915136
        val lng: String, // 116.35028
        val mile: String, // 118524.60
        val satl: String, // 5
        val speed: String, // 22
        val time: String, // 2022-03-28 00:00:03
        var dmile: String // 2022-03-28 00:00:03
    )

    data class OverspeedData(
        val blat: String, // 39.90571196611245
        val blng: String, // 116.36322382790567
        val endAddr: String, // 北京市西城区;西便门桥;复兴门(广电总局),明北京城城墙遗迹,广电总局宿舍
        val endTime: String, // 2022-03-28 00:02:03
        val glat: String, // 39.89993660152598
        val glng: String, // 116.35664672808063
        val lat: String, // 39.898584
        val lng: String, // 116.350464
        val long: String, // 瞬时超速
        val maxSpeed: String, // 52
        val mile: String, // 0.0米
        val startAddr: String, // 北京市西城区;西便门桥;复兴门(广电总局),明北京城城墙遗迹,广电总局宿舍
        val startTime: String // 2022-03-28 00:02:03
    )

    data class StopData(
        val add: String, // 北京市海淀区;吴家村路10号院-9号楼-8门-1层-102室;沄沄国际,海淀区文明社区,莲宝路10号院
        val blat: String, // 39.89576993220466
        val blng: String, // 116.30456976220756
        val dmile: String, // 0.00
        val endTime: String, // 2022-03-28 00:24:24
        val glat: String, // 39.889563405536585
        val glng: String, // 116.29812961215428
        val lat: String, // 39.888316
        val lng: String, // 116.292072
        val long: String, // 13分
        val mile: String, // 7.71
        val startTime: String // 2022-03-28 00:11:24
    )
}

/** 历史轨迹报警停车地点 */
data class HistoryGpsAlarm(
    val stime: String = "",
    val etime: String = "",
    val glat: String = "",
    val glng: String = "",
    val blat: String = "",
    val blng: String = "",
    val lat: String = "",
    val lng: String = "",
    val drct: String = "",
    val saddr: String = "",
    val eaddr: String = "",
    val long: String = "",
    val alarmType: String = "",
    val speed: String = "0",
    val mile: String = "",
    var dmile: String = ""
)


/** 查询信号线或者提醒 */
data class SgnRemind(
    val sgnStts: MutableList<NameValue>,
    val reminds: MutableList<NameValue>
)

/** 适用于所有Key Value */
data class NameValue(
    val name: String, // 近光灯
    val value: String // 关
)

/** 版本信息 */
data class Version(
    val id: String? = "",
    val desc: String? = "",
    val url2: String? = "",
    val prjName: String? = "",
    val name: String? = "",
    val seq: String? = "",
    val date: String? = "",
    val type: String? = "",
    val url: String? = "",
    val version: String? = "",
    val qr: String? = ""
)

/** 系统消息 */
@Parcelize
data class SystemMessage(
    var id: String = "",
    var date: String = "",
    var title: String = "",
    var msg: String = "",
    var auser: String = "",
    var files: String = "",
    var isRead: Boolean = false,
    var fileUrl: String = ""
) : Parcelable

/** 系统消息 */
@Parcelize
data class SystemMessages(
    val list: MutableList<SystemMessage> = mutableListOf()
) : Parcelable

/** 车队信息 */
data class TeamInfo(
    val teamName: String = "",
    val carNum: Int = 0,
    val pid: String = "",
    val teamId: String = ""
)

/** 车队车辆逐级查询 */
data class TeamsCars(
    val carList: List<CarInfo>,
    val teamList: List<TeamInfo>
)

/** 车辆信息 */
data class CarInfo(
    val stateCn: String = "",
    val carId: String = "",
    val iconLink: String = "",
    val state: String = "",
    val carName: String = "",
    val teamId: String = "",
    val teamName: String? = "",
    val acc: String = "",
    val videos: String?,
    val sim: String?,
    val plateColorCode: String?,
    val plateColor: String?,
    val carPlate: String = ""
)

/** 车辆列表 */
data class CarsInfo(val carList: MutableList<CarInfo>)

/** 模糊查询车辆 */
data class CarLick(
    val carId: String, // 105235
    val carName: String, // 演示04
    val carPlate: String, // 演示04
    val iconLink: String, // http://106.14.186.44:9999/gps-web/rs/img/map/car/default/10.png
    val videos: String?, // {"vs":"4::0:v,3::0:v,2::0:v,1::0:v"}
    val plateColor: String = "", // 黄色
    val plateColorCode: String = "", // 2
    val sim: String = "", // 15858288043
    val teamId: String = "", // 4771
    val teamName: String = "" // 一车队
)

/** 图例 */
data class Legend(
    val iconUrl: String = "",
    val stateIndex: String = "",
    val name: String = ""
)

/** 报警类型 */
data class AlarmType(
    val id: String = "",
    val name: String = "",
    var isAllChoose: Boolean = false,
    val children: MutableList<Children>
) {
    data class Children(
        val id: String = "",
        val name: String = "",
        var isChoose: Boolean = false
    )
}

/** 里程查询-按日 */
@Parcelize
data class DayMile(
    val mile: String = "",
    val list: ArrayList<MileInfo>,
    val long: String = ""
) : Parcelable {
    @Parcelize
    data class MileInfo(
        val name: String = "",
        val mile: String = ""
    ) : Parcelable
}

/** 历史报警 */
@Parcelize
data class HistoryAlarm(
    val total: String = "",
    val list: MutableList<TotalAlarms> = arrayListOf(),
    val long: String = ""
) : Parcelable {
    @Parcelize
    data class TotalAlarms(
        val total: Int,
        val name: String = "",
        val list: ArrayList<InfoAlarms>
    ) : Parcelable {
        @Parcelize
        data class InfoAlarms(
            val addr: String = "",
            val alarmType: String = "",
            val blat: String = "",
            val blng: String = "",
            val etime: String = "",
            val fjNum: String = "",
            val glat: String = "",
            val glng: String = "",
            val lat: String = "",
            val lng: String = "",
            val long: String = "",
            val ruleName: String = "",
            val solveDes: String = "",
            val solveState: String = "",
            val solveTime: String = "",
            val solveUser: String = "",
            val speed: String = "",
            val stime: String = ""

        ) : Parcelable
    }
}

/** 报警统计 */
@Parcelize
data class AlarmCount(
    val iconLink: String = "",
    val alarmNum: Int = 0,
    val alarmName: String = "",
    val alarmType: String = ""
) : Comparable<AlarmCount>, Parcelable {
    override fun compareTo(other: AlarmCount): Int {
        return other.alarmNum - this.alarmNum
    }
}

/** 报警详情 */
data class AlarmDetail(
    val drvPhone1: String = "",
    val carId: String = "",
    val fjNum: String?,
    val speed: String = "",
    val alarmName: String = "",
    val addr: String = "",
    val lng: String = "",
    val carPlate: String = "",
    val blng: String = "",
    val glat: String = "",
    val drvName1: String = "",
    val blat: String = "",
    val time: String = "",
    val glng: String = "",
    val ruleName: String = "",
    val carName: String = "",
    val alarmType: String = "",
    val lat: String = ""
)

/** 报警附件 */
@Parcelize
data class AlarmMedia(
    val mediaList: MutableList<MediaInfo>,
    val mediaNum: Int,
    val mediaType: String = ""
) : Parcelable {
    @Parcelize
    data class MediaInfo(
        val addr: String = "",
        val blat: String = "",
        val blng: String = "",
        val channel: String = "",
        val fullLink: String = "",
        val glat: String = "",
        val glng: String = "",
        val lat: String = "",
        val link: String = "",
        val lng: String = "",
        val reason: String = "",
        val speed: String = "",
        val time: String = ""
    ) : Parcelable
}

/** 历史照片 */
data class PhotoInfo(
    val time: String = "",
    val reason: String = "",
    val speed: String = "",
    val link: String = "",
    val fullLink: String = "",
    val addr: String = ""
)

/** 费用分析 */
@Parcelize
data class Fees(
    val fees: ArrayList<FeeInfo>
) : Parcelable

/** 费用信息 */
@Parcelize
data class FeeInfo(
    val insureFee: Double,
    val addOilCapacity: Double,
    val carId: String = "",
    val totalFee: Double,
    val mileOil: Double,
    val trafficFee: Double,
    val mile: Double,
    val dateSplit: String = "",
    val addOilFee: Double,
    val otherFee: Double,
    val repairFee: Double,
    val yearAdtFee: Double
) : Parcelable

/** 整体数据 */
data class AllData(
    val alarmTrends: List<AlarmTrend>,
    val offlineMap: OfflineMap,
    val stateDetails: List<StateDetail>,
    val alarmGroups: AlarmGroups
) {
    data class AlarmTrend(
        val nums: Float,
        val day: String = ""
    ) : Comparable<AlarmTrend> {
        override fun compareTo(other: AlarmTrend): Int {
            return other.nums.toInt() - this.nums.toInt()
        }
    }

    data class OfflineMap(
        val offNum3: Int,
        val offNum2: Int,
        val offNum1: Int
    )

    data class StateDetail(
        val totalNum: String = "",
        val accOnNum: String? = "",
        val accOffNum: String? = "",
        val stopNum: String = "",
        val storageNum: String = "",
        val runNum: String = "",
        val alarmNum: String = "",
        val nogpsNum: String = "",
        val offNum: String = "",
        val onNum: String = "",
        val invalidNum: String = ""
    )

    data class AlarmGroups(
        val adass: MutableList<Adas>,
        val normals: MutableList<Normal>,
        val videos: MutableList<Video>,
        val normal: Int,
        val adas: Int,
        val video: Int
    ) {
        data class Adas(
            val id: String = "",
            val iconLink: String = "",
            val name: String = "",
            val value: String = ""
        )

        data class Normal(
            val id: String = "",
            val iconLink: String = "",
            val name: String = "",
            val value: String = ""
        )

        data class Video(
            val id: String = "",
            val iconLink: String = "",
            val name: String = "",
            val value: String = ""
        )
    }
}

/** 停车统计 */
@Parcelize
data class StopStats(
    val total: String = "",
    val list: MutableList<StopInfo>?,
    val long: String = ""
) : Parcelable {
    @Parcelize
    data class StopInfo(
        val total: Int,
        val name: String = "",
        val list: ArrayList<StopDetail>?
    ) : Parcelable {
        @Parcelize
        data class StopDetail(
            val stime: String = "",
            val etime: String = "",
            val addr: String = "",
            val long: String = ""
        ) : Parcelable
    }
}

/** 模拟量设置 */
data class SensorCfg(
    val unit: String = "",
    val analogCode: String = "",
    val mnIndex: String = "",
    val name: String = ""
)

/** 模拟量统计 */
data class SensorInfo(
    val unit: String = "",
    val time: String = "",
    val moniValue: String = "",
    val realValue: String?
)

/** 提醒查询 */
data class RemindInfo(
    val carId: String = "",
    val now: String = "",
    val `set`: String = "",
    val name: String = "",
    val next: String = "",
    val plate: String = "",
    val type: String = ""
)

/** 整点状况 */
data class HourPoint(
    var time: String = "",
    val detail: PointInfo
) : Comparable<HourPoint> {
    data class PointInfo(
        val carId: String = "",
        val drct: Int,
        val exts: String = "",
        val lat: Double,
        val lng: Double,
        val mile: Int,
        val satl: Int,
        val sgn: Int,
        val sgnStts: String = "",
        val speed: Int,
        val state: Int,
        var time: String = "",
        val tmnMile: Int
    )

    override fun compareTo(other: HourPoint): Int {
        return time.replace("h", "").toInt() - other.time.replace("h", "").toInt()
    }
}

/** Acc统计 */
@Parcelize
data class AccStats(
    val offtime: Int,
    val time: String = "",
    val carId: String = "",
    val ontime: Int,
    val details: MutableList<AccInfo>?,
    val onratio: String = ""
) : Parcelable {
    @Parcelize
    data class AccInfo(
        val saddr: String? = "",
        val duration: Int,
        val time: String = "",
        val carId: String = "",
        val ison: Boolean,
        val eaddr: String? = "",
        val stime: String = "",
        val etime: String = ""
    ) : Parcelable
}

/** 车辆登退签 */
@Parcelize
data class CarSign(
    val duration: Long,
    val carId: String = "",
    val details: MutableList<SignDetail>,
    val mile: Int = 0,
    val repair: Boolean = false
) : Parcelable

/** 驾驶员登退签 */
@Parcelize
data class DriverSign(
    val idNo: String = "",
    val duration: Int,
    val carPlates: String = "",
    val details: MutableList<SignDetail>,
    val name: String = "",
    val mile: Int,
    val repair: Boolean
) : Parcelable

/** 登退签详情 */
@Parcelize
data class SignDetail(
    val onTime: String = "",
    val idNo: String = "",
    val duration: Int = 0,
    val carId: String = "",
    val offTime: String?,
    val name: String = "",
    val mile: Int,
    val offAddr: String?,
    val repair: Boolean = false,
    val onAddr: String = ""
) : Parcelable

/** 驾驶员信息 */
data class DriverInfo(
    val atime: String = "",
    val auser: String = "",
    val cmpId: String = "",
    val icCard: String = "",
    val id: String = "",
    val license: String = "",
    val name: String = "",
    val phone: String = "",
    val sex: String = "",
    val teamId: String = "",
    val exts: String = "",
    val picProtocol: String = "",
    val picSrc: String = ""
)

/** 流量统计 */
@Parcelize
data class FlowStats(
    val flows: MutableList<FlowInfo>,
    var total: Long,
    var long: Long
) : Parcelable

/** 流量信息 */
@Parcelize
data class FlowInfo(
    val day: String = "",
    val longs: Long,
    val total: Long,
    val gps: Long,
    val pic: Long,
    val video: Long,
    val adas: Long,
    val other: Long
) : Parcelable

/** 查岗历史 */
@Parcelize
data class CheckInfo(
    val checkId: String = "",
    val checkType: String = "",
    val cnt: String = "",
    val id: String = "",
    val joinCode: String = "",
    val joinId: String = "",
    val objId: String = "",
    val objName: String = "",
    val objType: String = "",
    val reply: String = "",
    val replyMan: String = "",
    val replyPhone: String = "",
    val replyTime: String = "",
    val seqNo: String = "",
    val serverTime: String = ""
) : Parcelable

/** 保险信息 */
@Parcelize
data class InsureInfo(
    val advanceRemindDays: Int,
    val agent: String = "",
    val atime: String = "",
    val auser: String = "",
    val carId: String = "",
    val claims: String?,
    val cmpId: String?,
    val discount: Int,
    val effectiveTime: String = "",
    val failureTime: String = "",
    val id: String = "",
    val insuranceCmp: String = "",
    val insuranceCode: String = "",
    val insuranceType: String = "",
    val phone: String = "",
    val price: Double,
    val realPrice: Double,
    val remark: String?
) : Parcelable

/** 证件信息 */
@Parcelize
data class CardInfo(
    val advanceRemindDays: Int,
    val atime: String = "",
    val auser: String = "",
    val brandModel: String?,
    val carId: String = "",
    val cmpId: String = "",
    val drivingCode: String?,
    val effectiveTime: String = "",
    val engineNumber: String?,
    val failureTime: String = "",
    val businessScope: String?,
    val transportCode: String?,
    val id: String = "",
    val remark: String?,
    val useNature: String?
) : Parcelable

/** 指令日志 */
data class CmdLog(
    val content: String?,
    val oper: String?,
    val time: String?,
    val typeId: String?,
    val carId: String?,
    val cmd: String?,
    val cmdId: String?,
    val `data`: String?,
    val ip: String?,
    val seqId: String?,
    val times: String?,
    val tmnKey: String?,
    val userId: String?,
    val utime: String?
)

/** 指令详情 */
data class CmdInfo(
    val id: String = "",
    val name: String = "",
    val cmd: String?
)

/** 指令类型 */
data class LogTypeInfo(
    val action: String = "",
    val id: String = "",
    val res: String = "",
    val seq: Int
)

/** 区域统计 */
data class RegionStats(
    val regionName: String = "",
    val carList: List<String>,
    val regionShape: String = "",
    val regionId: String = ""
)

/** 区域信息 */
@Parcelize
data class RegionInfo(
    val id: String = "",
    val name: String = "",
    val pid: String = "",
    val shape: String = "",
    val type: String = "",
    val radius: Int?,
    var isChecked: Boolean = false
) : Parcelable

/** 区域信息 */
@Parcelize
data class Regions(
    val tile: ArrayList<RegionInfo>
) : Parcelable

/** 区域查车 */
@Parcelize
data class RegionCar(
    val duration: Int,
    val time: String = "",
    val carId: String = "",
    val stopSeconds: Long?,
    val moveSeconds: Long?,
    val details: MutableList<Detail>,
    val mile: Int
) : Parcelable {
    @Parcelize
    data class Detail(
        val saddr: String = "",
        val duration: Long,
        val moveSeconds: Long?,
        val stopSeconds: Long?,
        val time: String = "",
        val carId: String = "",
        val eaddr: String = "",
        val stime: String = "",
        val etime: String = "",
        val mile: Int,
        val areas: String = ""
    ) : Parcelable
}

/** 离线统计信息 */
@Parcelize
data class OfflineInfo(
    val carName: String = "",
    val carPlate: String = "",
    val lineTime: String = "",
    val nowTime: String = "",
    val offlineTime: String = "",
    val simCode: String? = "",
    val teamName: String = "",
    val addr: String?,
    val time: String?,
    val tmnCode: String? = ""
) : Parcelable

/** 欠费统计信息 （运营状况） */
@Parcelize
data class ArrearsInfo(
    val teamName: String = "",
    val expTime: String = "",
    val atime: String = "",
    val appear: String = "",
    val carName: String = "",
    val expModel: String = "",
    val auser: String = "",
    val carPlate: String = ""
) : Parcelable

/** 短信指令 */
data class SmsCmdInfo(
    val children: MutableList<Children>,
    val name: String = ""
) {
    data class Children(
        val children: MutableList<Children>,
        val name: String = ""
    ) {
        data class Children(
            val cmd: String = "",
            val desc: String = ""
        )
    }
}

/** 维修列表 */
@Parcelize
data class RepairInfo(
    val id: String = "",
    val carId: String = "",
    val tickTime: String? = "",
    val plate: String? = "",
    val tickPhone: String? = "",
    val tmnKey: String? = "",
    val tmnNo: String? = "",
    val tickName: String? = "",
    val auser: String = "",
    val simCard: String? = "",
    val tickDesc: String? = "",
    val imgs: ArrayList<String>
) : Parcelable

/** 登录历史 */
data class HistoryLogin(
    val time: String = "",
    val addr: String = "",
    val ip: String = ""
)

/** 关于我们 */
data class AboutUs(
    val platformUrl: String = "",
    val cmpUrl: String = "",
    val phone: String = "",
    val email: String = "",
    val cnName: String = "",
    val list: MutableList<AboutInfo>,
    val addr: String = "",
    val linkman: String = "",
    val date: String?,
    val version: String = ""
) {
    data class AboutInfo(
        val id: String = "",
        val name: String = "",
        val seq: String = "",
        val qr: String = "",
        val version: String = ""
    )
}

/** 更新 */
data class UpdateEntity(
    val status: Int,
    val time: Long,
    val result: Result
) {
    data class Result(
        val links: List<Link>,
        val version: Int,
        val versionDate: String = "",
        val versionName: String? = "",
        val userId: String = "",
        val updateDesc: String = ""
    ) {
        data class Link(
            val name: String = "",
            val seq: Int,
            val des: String = "",
            val typeId: String = "",
            val id: String = "",
            val cfg: String = "",
            val pack: String = "",
            val brand: String = ""
        )
    }
}

/** 欠费通知 */
@Parcelize
data class ArrearsNotice(
    val expire: MutableList<Expire> = arrayListOf(),
    val willExpire: MutableList<Expire> = arrayListOf()
) : Parcelable {
    @Parcelize
    data class Expire(
        val atime: String = "",
        val auser: String = "",
        val carId: String = "",
        val des: String = "",
        val endDay: String = "",
        val id: String = "",
        val money: String = "",
        val name: String = "",
        val plate: String = "",
        val result: String = "",
        val startDay: String = ""
    ) : Parcelable
}

/** 常用文本信息 */
data class CmdNote(
    val sysList: List<String> = mutableListOf(),
    val userList: List<String>? = mutableListOf()
)

/** 设备异常信息 */
data class DeviceExc(
    val count: Int = 0,
    val name: String = "",
    val real_name: String = ""
)

/** 设备异常详情 */
data class DeviceInfo(
    val addr: String = "",
    val alarm: List<String> = listOf(),
    val carId: String = "",
    val name: String = "",
    val plate: String = "",
    val owner: String? = "",
    val ownerPhone: String? = "",
    val satl: Int = 0,
    val sgn: Int = 0,
    val state: Int = 0,
    val time: String = ""
)

/** 联系我们 */
data class ContactUs(
    val addr: String = "",
    val name: String = "",
    val phone: String = "",
    val pic: String = "",
    val picUrl: String = "",
    val type: String = "",
    val qq: String = "",
    val wechat: String = ""
)

/** 周边车辆 */
data class CarAround(
    val accTime: String, // 当前[开] 今日开:13时23分33秒
    val addr: String, // 海南省海口市秀英区长流镇;长安路;阳光西海岸-一期,阳光西海岸,天佑大酒店
    val blat: String, // 20.045642981580112
    val blng: String, // 110.23276923608195
    val carId: String, // 108321
    val carName: String, // 演示车11
    val carPlate: String, // 演示车11
    val distance: String, // 0.00
    val drct: String, // 268
    val drctCn: String, // 偏西
    val glat: String, // 20.039956328536437
    val glng: String, // 110.22621231418552
    val iconLink: String, // http://106.14.186.44:9999/gps-web/rs/img/map/car/car_police/10.png
    val lat: String, // 20.042098
    val lng: String, // 110.221949
    val runStopTime: String, // 停-35分2秒
    val speed: String, // 0
    val state: String, // 10
    val stateCn: String, // 在线-停车-ACC开
    val time: String // 2022-03-11 15:40:07
)

/** 字典 */
data class Dictionary(
    val CAR_TYPE: MutableList<CarType>,
    val rspCode: String = "",
    val PLATE_COLOR: MutableList<PlateColor>
) {
    data class CarType(
        val id: String = "",
        val name: String = "",
        val pid: String = ""
    )

    data class PlateColor(
        val id: String = "",
        val name: String = ""
    )
}

/**
 */
@Parcelize
data class QrCode(
    val teamName: String = "",
    val carType: String = "",
    val drvName: String = "",
    val carName: String = "",
    val plate: String = "",
    val addr: String = "",
    val tmnNo: String = "",
    val drvPhone: String = "",
    val simCard: String = ""
) : Parcelable, CmdReply()

/** 发送指令回复 */
open class CmdReply(var rspCode: String = "", var rspDesc: String? = "失败原因未返回")

/**
 * ********************************* 自定义
 * ************************************************
 */

/** 历史视频 */
data class HistoryVideo(
    val state: String,
    val result: MutableList<Result>
) {
    data class Result(
        val storeType: Int,
        val avType: Int,
        val streamType: Int,
        val fileSize: Long,
        val channel: Int,
        val startTime: String = "",
        val endTime: String = "",
        val alarmFlag: String = "",
        val fileName: String = "",
        val fileId: String = "",
        var duration: Long = 0
    ) : Serializable
}

/** 用户列表 */
@Parcelize
data class UserList(
    var list: MutableList<UserInfo> = arrayListOf()
) : Parcelable

@Parcelize
data class UserInfo(
    var ip: String = UserConstant.current_ip,
    var port: String = UserConstant.current_port,
    var platform: String = "",
    var userName: String = "",
    var userPwd: String = "",
    var carName: String = "",
    var carPwd: String = "",
    var isRemember: Boolean = true,
    var isAuto: Boolean = false,
    var isCarRemember: Boolean = true,
    var isCarAuto: Boolean = false,
    var homeShow: String = "home",
    var plateColor: String = "",
    var colorId: String = "",
    var loginType: String = Keys.LOGIN_TYPE_USER,
    var videos: String? = ""
) : Parcelable


/** 视频报警 */
data class VideoAlarm(
    val alarmImgId: Int,
    val alarmTitleId: Int,
    var isNormal: Boolean = false
)

/** 车队车辆选择类 */

data class ChooseTeamCar(
    val pid: String = "",
    val carId: String = "",
    val carNum: Int = 0,
    val teamId: String = "",
    val carName: String = "",
    val carPlate: String = "",
    val teamName: String = "",
    val iconLink: String = "",
    val accState: String = "",
    val state: String = "",
    val videos: String? = "",
    val isVideo: Boolean = false
)

/** 选择的时间 */
data class ChooseTime(
    val timeNameId: Int,
    val timeType: Int = 4,
    val timeNum: Int
)

/** @Author Jasper @Time 2020/7/24 @Desc 历史车辆数据 */
@Parcelize
data class HistoryCars(
    val list: MutableList<ListBean> = ArrayList()
) : Parcelable {
    @Parcelize
    data class ListBean(
        val carId: String = "",
        val carName: String = "",
        val carPlate: String = "",
        var iconLink: String = "",
        var videos: String? = "",
        var isVideo: Boolean = false
    ) : Parcelable
}

data class KeyValue(val key: String, val value: String)


/** 搜索历史 */
@Parcelize
data class KeyWords(
    val words: MutableList<String> = mutableListOf()
) : Parcelable

/** 推送消息 */
data class PushMsg(
    val type: String,
    val content: MsgInfo
) {
    data class MsgInfo(
        val carName: String = "",
        val alarmName: String = "",
        val addr: String = "",
        val carPlate: String = ""
    )
}

/** CarTab */
data class CarTab(val tabTitleId: Int, val tabImgId: Int)

/** 通知消息文件 */
data class NoticeFiles(
    val id: String = "",
    val name: String = "",
    val suffix: String = ""
)

/** 实时视频实体类 */

data class RealVideoInfo(
    var uuid: String = "",
    var videoStream: String = "1",
    var videoPass: String = "",
    var videoName: String = "",
    val toast: String = ""
)


/** 视频通道 */
data class VideosPass(
    val vs: String = "",
    val tc: Int
)

/** 车辆基础性息 */
data class CarBaseInfo(
    val plate: String,
    val carName: String,
    val color: String,
    val teamName: String,
    val videoPass: String
)


/** 费用录入 */
class CostEntry(val title: String, val imageId: Int)

/** 临时跟踪 */
data class GpsTrack(val interval: String, val duration: String)

/** 文本信息 */
data class SendText(val signBit: String, val textMsg: String, val textType: String = "1")

/** 油电控制 */
data class OilElectric(val command: String)

/** data class OilElectric(val command: String) */
data class ElectricDefine(val flag: String, val authCode: String = "1010101")

/** name 标题 isSwitching 是否开启 num 排序 */
data class LocationStatus(
    val key: String,
    var switch: Int,
    var value: String = ""
)

/** 标注 */
data class LocationPoi(
    val addr: String?, // 浙江省台州市椒江区赤山路
    val atime: String, // 2021-01-30 17:38:29
    val auser: String, // admin
    val blat: Double?, // 28.66443569942224
    val blng: Double?, // 121.43862729508616
    val cmpId: String, // 1
    val exts: String?, // {"bzfx":"1212"}
    val format: String?, // jspx
    val glat: Double?, // 28.65810536951957
    val glng: Double?, // 121.43222398013118
    val icon: String?, // 公共设施/生活服务.png
    val id: String, // 471
    val lat: Double?, // 28.6610599361975
    val lng: Double?, // 121.42780347176063
    val name: String, // 演示专用
    val pid: String, // 0
    val radius: Int?, // 500
    val type: String, // 0
    val updateTime: String, // 2021-01-30 17:38:29
    val zcode: String? // 331002_中国 浙江省 台州市 椒江区
)

/** 登录前设置 */
data class LoginPre(
    val loginSms: Boolean,
    val plateColorVfy: Boolean
)

/**
 * **********************************************************************************
 */
data class AllMenuCfg(val titleId: Int, val keys: ArrayList<MenuNo>)
data class MenuNo(val key: String, val no: Int, var isChoose: Boolean = false)
data class MenuCfg(
    val key: String,
    val titleId: Int = 0,
    val icon: Int = 0,
    val title: String = "",
    val iconLink: String = "",
    val webUrl: String = ""
)

/** arrears：欠费通知开关 alarms：报警通知开关 alarmFilter：过滤无报警类型开关 */
data class InfoSwitch(
    val arrears: Boolean = true,
    val alarms: Boolean = false,
    val alarmFilter: Boolean = false
)

/**
 * Video state 视频状态
 *
 * @property state
 * @constructor Create empty Video state
 */
data class VideoState(val state: String?)
